package com.ruoyi.rva.service;

import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.rva.domain.RvaApp;
import com.ruoyi.rva.domain.RvaView;
import com.ruoyi.rva.domain.RvaViewbutton;

import java.util.List;

public interface IRvaMetaService {

    void createObject(String table);

    void deleteObject(String table);

    void createCrud(String table);

    public String createViewId (String objId, String prefix);

    RvaView cloneSingleView(String srcViewId, Boolean cascaded);

    RvaView cloneView(String srcViewId, String prefix, Boolean cascaded);

    void deleteApp(String crudId);

    void deleteView(String viewId);

    void deleteViewbutton(String buttonId);

    void deleteViewproperty(String viewpropertyId);

    void createMenuAndButtons(String crudId, Long parentId, Integer orderNum);

    void deleteMenuAndButtons(String... appIds);

    void createRvaMenu();

    RvaApp createTreeCrud (List<String> contents, List<String> navs);

    void addContentsToTreeCrud(List<String> contents, String appId);

    void addNavsToTreeCrud(List<String> navs, String appId);

    SysDictType createDictData(String table, String typeCnName, String defaultValue, String[] data, Boolean containValue);

    default String createPropertyId(String table, String columnName) {
        return (table + "_" + columnName).toLowerCase();
    }

    default String createViewpropertyId(String viewId, String propName) {
        return (viewId + "_" + propName).toLowerCase();
    }

    RvaApp cloneApp(String appId, Boolean cascaded, Boolean cascadeDelete);

    void deleteApp(List<String> appIds);
}
